#include <ros/ros.h>
#include <learning_service/Person.h>

int main(int arg, char **args)
{
    ros::init(arg, args, "person_client");
    ros::NodeHandle node;

    ros::service::waitForService("/show_person");
    ros::ServiceClient person_client = node.serviceClient<learning_service::Person>("/show_person");

    learning_service::Person person_srv;
    person_srv.request.name = "Tom";
    person_srv.request.sex = learning_service::Person::Request::male;
    person_srv.request.age = 18;

    ROS_INFO("Call service to show person[name:%s, sex:%d, age:%d]",
        person_srv.request.name.c_str(), person_srv.request.sex, person_srv.request.age);

    person_client.call(person_srv);

    ROS_INFO("Show person result : %s", person_srv.response.result.c_str());

    return 0;
}